package com.spring.Controller;

import com.spring.Model.Alumno;
import com.spring.Service.AlumnoService;
import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller("AlumnoController")
@Scope("Session")

public class AlumnoController {
    @Autowired
    private AlumnoService AluS;
    private Alumno Alu;
    
    @PostConstruct
    public void init(){
        Alu = new Alumno();
    }
    
    //@RequestM
    public String Valida(){
        String Aux=AluS.Validar(Alu);
        return Aux;
    }
    
    @RequestMapping("/page")
    public ModelAndView pageHandler(HttpServletRequest request){
        return new ModelAndView("page");
    }
    
    // Getter & Setter

    public Alumno getAlu() {
        return Alu;
    }

    public void setAlu(Alumno Alu) {
        this.Alu = Alu;
    }

    public AlumnoService getAluS() {
        return AluS;
    }

    public void setAluS(AlumnoService AluS) {
        this.AluS = AluS;
    }

}
